<template>
  <div class="s-questionList">
    <template v-if="state.questionList && state.questionList.length > 0">
      <div class="item" v-for="d in state.questionList" :key="d.id">
        <div class="questionW">
          <p>问： {{ d.title }}</p>
          <p>答： {{ d.content }}</p>
        </div>
        <div class="time">{{ d.create_time ? d.create_time.substr(0, 10) : "" }}</div>
      </div>
    </template>
    <el-empty v-else></el-empty>
  </div>
</template>
<script setup>
import { ref, reactive, onMounted, inject } from "vue";


const http = inject("ajax");

onMounted(() => {
  getData();
});



let state = reactive({
  questionList: [],
});
const getData = () => {
  http("/iaiqsmde9fea569965ed56ab98ea0501752fe631902841e/interactive/queryQuestion", {}, "GET")
    .then(res => {
      if (res.code == 0) {
        state.questionList = res.data.rows;
      }
    })
    .catch(err => {
      console.log(err.message || "数据异常");
    });
};
</script>
